var vue = new Vue({
    el:"#main-container",
    data:{
        condition:{
            startDate:'',
            endDate:'',
            type:'',
            check:''
        },
        pageInfo:{
            current:1,
            size:5
        },
        qualification:{}
    },
    methods:{
        select(pageNum,pageSize){
            axios({
                url:`/manager/qualification/select/${pageNum}/${pageSize}`,
                params:this.condition,
            }).then((data) =>{
                console.log(data);
                this.pageInfo = data.data.data;
            }).catch(function (error) {
                console.log(error);
            })
        },
        selectAll(){
            this.condition = {
                startDate:'',
                type:'',
                check:'',
                endDate:'',
            };
            this.select(1,this.pageInfo.size);
        },
        toUpdate(qualificationId){
            axios({
                url:'/manager/qualification/selectOne',
                params: {id:qualificationId}
            }).then(response=>{
                if (response.data.code!=200) {
                    layer.msg(response.data.msg); // 弹出提示框
                    return;
                }
                layer.qualification = response.data.data;
                console.log(layer);
                //打开layer的所在的页面
                layer.open({
                    type:2,//类型：0信息框  1 页面层  2 iframe层  3 加载层  4 tips层
                    title:'更新资质审核',
                    content: '/manager/qualification/qualification-update.html',
                    area: ['60%','80%'],
                    end: ()=>{
                        this.select(this.pageInfo.current,this.pageInfo.size);
                    }
                })
            });
        }
    },
    created(){
        this.select(1, this.pageInfo.size);
    }

})